package gen.kaynak.navitrack.messageProcessStrategy;

import gen.kaynak.navitrack.messageProcessState.*;

public class NSEWProcessor implements IMessageProcessStrategy {

	@Override
	public boolean ProcessChar(char c, MessageProcessStateManager mpm) {
		if (mpm.getNowProcessing() == "Latitude") {
			switch (c) {
			case 'n':
				mpm.setSign("+");
				break;
			case 'N':
				mpm.setSign("+");
				break;
			case 's':
				mpm.setSign("-");
				break;
			case 'S':
				mpm.setSign("-");
				break;
			default:
				return false;
			}
			return true;
		} else if (mpm.getNowProcessing() == "Longitude") {
			switch (c) {
			case 'e':
				mpm.setSign("+");
				break;
			case 'E':
				mpm.setSign("+");
				break;
			case 'w':
				mpm.setSign("-");
				break;
			case 'W':
				mpm.setSign("-");
				break;
			default:
				return false;
			}
			return true;
		} else {
			return false;

		}
	}
}
